home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / OWL / SETWPLAC / SETWPLAC.PAS
Pascal/Delphi Source File  |  1994-03-02  |  2KB  |  61 lines

  1. {************************************************}
  2. {                                                }
  3. {   ObjectWindows Demo                           }
  4. {   Copyright (c) 1992 by Borland International  }
  5. {                                                }
  6. {************************************************}
  7.  
  8. program SetWPlac;
  9.  
  10. uses WinTypes, WinProcs, OWindows, Win31;
  11.  
  12. type
  13.   PStepWindow = ^TStepWIndow;
  14.   TStepWindow = object(TWindow)
  15.     constructor Init(AParent: PWindowsObject; ATitle: PChar);
  16.     procedure WMLButtonDown(var Msg: TMessage);
  17.       virtual wm_First + wm_LButtonDown;
  18.   end;
  19.  
  20.   TMyApplication = object(TApplication)
  21.     procedure InitMainWindow; virtual;
  22.   end;
  23.  
  24. constructor TStepWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  25. begin
  26.   inherited Init(AParent, ATitle);
  27. end;
  28.  
  29.  
  30. procedure TStepWindow.WMLButtonDown(var Msg: TMessage);
  31. const
  32.   Gl1Placement: TWindowPlacement = (Length: 22; Flags: WPF_SetMinPosition;
  33.                                     ShowCmd: Sw_Maximize;
  34.                                     PtMinPosition: (x:1; y: 1);
  35.                                     ptMaxPosition: (x:10; y: 10);
  36.                                     rcNormalPosition: (Left:1; Top:1;
  37.                                                        Right:100; Bottom:100)
  38.                                     );
  39.  
  40. var
  41.   Size: Integer;
  42. begin
  43.   MessageBeep($FFFF);
  44.   { Gl1Placement.rcNormalPosition }
  45.   Size := SizeOf(TWindowPlacement);
  46.   SetWindowPlacement(HWindow, @Gl1Placement);
  47. end;
  48.  
  49. procedure TMyApplication.InitMainWindow;
  50. begin
  51.   MainWindow := New(PStepWindow, Init(nil, 'Steps'));
  52. end;
  53.  
  54. var
  55.   MyApp: TMyApplication;
  56.  
  57. begin
  58.   MyApp.Init('Steps');
  59.   MyApp.Run;
  60.   MyApp.Done;
  61. end.